﻿using HP48CSharp.Core;
using System.Globalization;
namespace HP48CSharp.Entities
{

    internal class OperationCompiler : CSharpCompilerCore
    {
        public OperationCompiler()
        {

        }
        public OperationCompiler(Heap heap, char c)
        {
            var o1 = heap.Get(heap.Count - 1);
            var o2 = heap.Get(heap.Count - 2);
            this.Function = string.Format( new CultureInfo("en-es"), "{0}{1}{2}", o1.ToString(), c.ToString(), o2.ToString());

            this.Template = @"
           using System;
            public class Calculator
            {{
              public static object Execute()
              {{ 
               return {0}; 
              }}
            }}";
        }

    }
}
